<?php

namespace App\Models;

use Dcat\Admin\Models\Administrator;
use Dcat\Admin\Traits\HasDateTimeFormatter;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Carbon;
use Illuminate\Support\Collection;

/**
 * App\Models\News
 *
 * @property array $partition_ids
 * @property array $area_ids
 * @property array $school_ids
 * @property Administrator|null $admin
 * @property Category|null $category
 * @method static Builder|News newModelQuery()
 * @method static Builder|News newQuery()
 * @method static Builder|News query()
 * @mixin \Eloquent
 * @property int $id
 * @property int $admin_id 账号ID
 * @property int $category_id 分类ID
 * @property string $title 资讯标题
 * @property string|null $image 资讯列表图
 * @property string $content 资讯详情
 * @property int $status 显示状态:0=正常,1=隐藏
 * @property int $state 发布状态:0=待发布,1=通过发布,2=拒绝发布
 * @property string|null $reason 拒绝原因
 * @property Carbon|null $created_at
 * @property Carbon|null $updated_at
 * @method static Builder|News whereAdminId($value)
 * @method static Builder|News whereAreaIds($value)
 * @method static Builder|News whereCategoryId($value)
 * @method static Builder|News whereContent($value)
 * @method static Builder|News whereCreatedAt($value)
 * @method static Builder|News whereId($value)
 * @method static Builder|News whereImage($value)
 * @method static Builder|News wherePartitionIds($value)
 * @method static Builder|News whereReason($value)
 * @method static Builder|News whereSchoolIds($value)
 * @method static Builder|News whereState($value)
 * @method static Builder|News whereStatus($value)
 * @method static Builder|News whereTitle($value)
 * @method static Builder|News whereUpdatedAt($value)
 */
class News extends Model
{
	use HasDateTimeFormatter;

    protected $casts = [

    ];

    protected $appends = [

    ];


    public static function getList(): Collection
    {
        return self::query()->where("status",0)->pluck("content");
    }

}
